<head>
  <meta name="layout" content="main"/>
  <title>Edit Account</title>
</head>

<body>
<div class="span-30 inner">
  <div class="nav">
    <span class="menuButton"><g:link action="edit">Edit Account</g:link></span>
    <span class="menuButton"><g:link action="icon">Upload Icon</g:link></span>
  </div>

  <h1>Edit Account</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${account}">
    <div class="errors">
      <g:renderErrors bean="${account}" as="list"/>
    </div>
  </g:hasErrors>

  <g:form>
    <input type="hidden" name="id" value="${account.id}"/>
    <input type="hidden" name="version" value="${account.version}"/>
    <div class="dialog">
      <table>
        <tbody>

        <tr class="prop">
          <td><mw:icon username="${account.username}"/></td>
          <td></td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name"><label for="username">Login Name:</label></td>
          <td valign="top" class="value">${account.username}</td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name"><label for="userRealName">Full Name:</label></td>
          <td valign="top" class="value ${hasErrors(bean: account, field: 'userRealName', 'errors')}">
            <input type="text" id="userRealName" name="userRealName" value="${account.userRealName}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name"><label for="passwd">Password:</label></td>
          <td valign="top" class="value ${hasErrors(bean: account, field: 'passwd', 'errors')}">
            <input type="password" id="passwd" name="passwd" value="${account.passwd}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name"><label for="description">Description:</label></td>
          <td valign="top" class="value ${hasErrors(bean: account, field: 'description', 'errors')}">
            <g:textArea name="description">${account.description}</g:textArea>
          </td>
        </tr>

        </tbody>
      </table>
    </div>

    <div class="buttons">
      <span class="button"><g:actionSubmit class="save" value="Update"/></span>
    </div>

  </g:form>

</div>
</body>
